package initer

import (
	"flag"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/logs"
)

var loaded bool = false

func init() {
	if loaded {
		return
	}
	loaded = true
	profile := flag.String("P", "dev", "profile")
	flag.Parse()
	logs.Info("load profile:", *profile)
	beego.BConfig.RunMode = *profile
	beego.BConfig.Listen.HTTPPort = beego.AppConfig.DefaultInt("httpport", 8181)
}
